package com.github.catvod.spider.merge;

import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
import java.util.HashMap;

public class XR {
  private static final HashMap<String, String> V0;
  
  private static final char[] h = new char[] { ',', ';' };
  
  private static final HZ.Tw j;
  
  static {
    V0 = new HashMap<String, String>();
    j = new HZ.Tw();
  }
  
  public static boolean BQ(String paramString) {
    boolean bool;
    if (HA.j.u(paramString) != -1) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  static void I(Appendable paramAppendable, String paramString, HZ.Tw paramTw, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) {
    // Byte code:
    //   0: aload_2
    //   1: invokevirtual I : ()Lcom/github/catvod/spider/merge/XR$HA;
    //   4: astore #16
    //   6: aload_2
    //   7: invokevirtual q : ()Ljava/nio/charset/CharsetEncoder;
    //   10: astore #17
    //   12: aload_2
    //   13: getfield q : Lcom/github/catvod/spider/merge/XR$yh;
    //   16: astore #15
    //   18: aload_1
    //   19: invokevirtual length : ()I
    //   22: istore #12
    //   24: iconst_0
    //   25: istore #11
    //   27: iconst_0
    //   28: istore #8
    //   30: iconst_0
    //   31: istore #7
    //   33: iload #11
    //   35: iload #12
    //   37: if_icmpge -> 425
    //   40: aload_1
    //   41: iload #11
    //   43: invokevirtual codePointAt : (I)I
    //   46: istore #13
    //   48: iload #8
    //   50: istore #10
    //   52: iload #7
    //   54: istore #9
    //   56: iload #4
    //   58: ifeq -> 128
    //   61: iload #13
    //   63: invokestatic u : (I)Z
    //   66: ifeq -> 122
    //   69: iload #5
    //   71: ifeq -> 87
    //   74: iload #8
    //   76: istore #10
    //   78: iload #7
    //   80: istore #9
    //   82: iload #8
    //   84: ifeq -> 404
    //   87: iload #7
    //   89: ifeq -> 103
    //   92: iload #8
    //   94: istore #10
    //   96: iload #7
    //   98: istore #9
    //   100: goto -> 404
    //   103: aload_0
    //   104: bipush #32
    //   106: invokeinterface append : (C)Ljava/lang/Appendable;
    //   111: pop
    //   112: iconst_1
    //   113: istore #9
    //   115: iload #8
    //   117: istore #10
    //   119: goto -> 404
    //   122: iconst_1
    //   123: istore #10
    //   125: iconst_0
    //   126: istore #9
    //   128: iload #13
    //   130: ldc 65536
    //   132: if_icmpge -> 360
    //   135: iload #13
    //   137: i2c
    //   138: istore #6
    //   140: iload #6
    //   142: bipush #34
    //   144: if_icmpeq -> 332
    //   147: iload #6
    //   149: bipush #38
    //   151: if_icmpeq -> 320
    //   154: iload #6
    //   156: bipush #60
    //   158: if_icmpeq -> 271
    //   161: iload #6
    //   163: bipush #62
    //   165: if_icmpeq -> 243
    //   168: iload #6
    //   170: sipush #160
    //   173: if_icmpeq -> 211
    //   176: aload #15
    //   178: iload #6
    //   180: aload #17
    //   182: invokestatic j : (Lcom/github/catvod/spider/merge/XR$yh;CLjava/nio/charset/CharsetEncoder;)Z
    //   185: ifeq -> 200
    //   188: aload_0
    //   189: iload #6
    //   191: invokeinterface append : (C)Ljava/lang/Appendable;
    //   196: pop
    //   197: goto -> 404
    //   200: aload_0
    //   201: aload #16
    //   203: iload #13
    //   205: invokestatic V0 : (Ljava/lang/Appendable;Lcom/github/catvod/spider/merge/XR$HA;I)V
    //   208: goto -> 404
    //   211: aload #16
    //   213: getstatic com/github/catvod/spider/merge/XR$HA.h : Lcom/github/catvod/spider/merge/XR$HA;
    //   216: if_acmpeq -> 231
    //   219: aload_0
    //   220: ldc '&nbsp;'
    //   222: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   227: pop
    //   228: goto -> 404
    //   231: aload_0
    //   232: ldc '&#xa0;'
    //   234: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   239: pop
    //   240: goto -> 404
    //   243: iload_3
    //   244: ifne -> 259
    //   247: aload_0
    //   248: ldc '&gt;'
    //   250: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   255: pop
    //   256: goto -> 404
    //   259: aload_0
    //   260: iload #6
    //   262: invokeinterface append : (C)Ljava/lang/Appendable;
    //   267: pop
    //   268: goto -> 404
    //   271: iload_3
    //   272: ifeq -> 308
    //   275: aload #16
    //   277: getstatic com/github/catvod/spider/merge/XR$HA.h : Lcom/github/catvod/spider/merge/XR$HA;
    //   280: if_acmpeq -> 308
    //   283: aload_2
    //   284: invokevirtual Qy : ()Lcom/github/catvod/spider/merge/HZ$Tw$Tw;
    //   287: getstatic com/github/catvod/spider/merge/HZ$Tw$Tw.V0 : Lcom/github/catvod/spider/merge/HZ$Tw$Tw;
    //   290: if_acmpne -> 296
    //   293: goto -> 308
    //   296: aload_0
    //   297: iload #6
    //   299: invokeinterface append : (C)Ljava/lang/Appendable;
    //   304: pop
    //   305: goto -> 404
    //   308: aload_0
    //   309: ldc '&lt;'
    //   311: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   316: pop
    //   317: goto -> 404
    //   320: aload_0
    //   321: ldc '&amp;'
    //   323: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   328: pop
    //   329: goto -> 404
    //   332: iload_3
    //   333: ifeq -> 348
    //   336: aload_0
    //   337: ldc '&quot;'
    //   339: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   344: pop
    //   345: goto -> 404
    //   348: aload_0
    //   349: iload #6
    //   351: invokeinterface append : (C)Ljava/lang/Appendable;
    //   356: pop
    //   357: goto -> 404
    //   360: new java/lang/String
    //   363: dup
    //   364: iload #13
    //   366: invokestatic toChars : (I)[C
    //   369: invokespecial <init> : ([C)V
    //   372: astore #14
    //   374: aload #17
    //   376: aload #14
    //   378: invokevirtual canEncode : (Ljava/lang/CharSequence;)Z
    //   381: ifeq -> 396
    //   384: aload_0
    //   385: aload #14
    //   387: invokeinterface append : (Ljava/lang/CharSequence;)Ljava/lang/Appendable;
    //   392: pop
    //   393: goto -> 404
    //   396: aload_0
    //   397: aload #16
    //   399: iload #13
    //   401: invokestatic V0 : (Ljava/lang/Appendable;Lcom/github/catvod/spider/merge/XR$HA;I)V
    //   404: iload #11
    //   406: iload #13
    //   408: invokestatic charCount : (I)I
    //   411: iadd
    //   412: istore #11
    //   414: iload #10
    //   416: istore #8
    //   418: iload #9
    //   420: istore #7
    //   422: goto -> 33
    //   425: return
  }
  
  private static void V0(Appendable paramAppendable, HA paramHA, int paramInt) {
    String str = paramHA.Qy(paramInt);
    if (!"".equals(str)) {
      paramAppendable.append('&').append(str).append(';');
    } else {
      paramAppendable.append("&#x").append(Integer.toHexString(paramInt)).append(';');
    } 
  }
  
  private static void W(HA paramHA, String paramString, int paramInt) {
    HA.V0(paramHA, new String[paramInt]);
    HA.q(paramHA, new int[paramInt]);
    HA.oC(paramHA, new int[paramInt]);
    HA.W(paramHA, new String[paramInt]);
    UF uF = new UF(paramString);
    boolean bool = false;
    byte b;
    for (b = 0; !uF.PU(); b++) {
      paramString = uF.n('=');
      uF.h();
      int i = Integer.parseInt(uF.i4(h), 36);
      byte b1 = uF.GM();
      uF.h();
      if (b1 == 44) {
        int k = Integer.parseInt(uF.n(';'), 36);
        uF.h();
      } else {
        b1 = -1;
      } 
      int j = Integer.parseInt(uF.n('&'), 36);
      uF.h();
      HA.h(paramHA)[b] = paramString;
      HA.j(paramHA)[b] = i;
      HA.I(paramHA)[j] = i;
      HA.BQ(paramHA)[j] = paramString;
      if (b1 != -1)
        V0.put(paramString, new String(new int[] { i, b1 }, 0, 2)); 
    } 
    if (b == paramInt)
      bool = true; 
    R2.q(bool, "Unexpected count of entities loaded");
  }
  
  private static boolean j(yh paramyh, char paramChar, CharsetEncoder paramCharsetEncoder) {
    int i = Tw.h[paramyh.ordinal()];
    boolean bool = true;
    if (i != 1)
      return (i != 2) ? paramCharsetEncoder.canEncode(paramChar) : true; 
    if (paramChar >= '')
      bool = false; 
    return bool;
  }
  
  public static boolean oC(String paramString) {
    boolean bool;
    if (HA.V0.u(paramString) != -1) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  public static int q(String paramString, int[] paramArrayOfint) {
    String str = V0.get(paramString);
    if (str != null) {
      paramArrayOfint[0] = str.codePointAt(0);
      paramArrayOfint[1] = str.codePointAt(1);
      return 2;
    } 
    int i = HA.j.u(paramString);
    if (i != -1) {
      paramArrayOfint[0] = i;
      return 1;
    } 
    return 0;
  }
  
  public enum HA {
    V0, h, j;
    
    private static final HA[] q;
    
    private int[] BQ;
    
    private String[] I;
    
    private String[] W;
    
    private int[] oC;
    
    static {
      HA hA3 = new HA("xhtml", 0, WG.h, 4);
      h = hA3;
      HA hA1 = new HA("base", 1, WG.V0, 106);
      V0 = hA1;
      HA hA2 = new HA("extended", 2, WG.j, 2125);
      j = hA2;
      q = new HA[] { hA3, hA1, hA2 };
    }
    
    HA(String param1String1, int param1Int1) {
      XR.h(this, param1String1, param1Int1);
    }
    
    public static HA oq(String param1String) {
      return Enum.<HA>valueOf(HA.class, param1String);
    }
    
    String Qy(int param1Int) {
      int i = Arrays.binarySearch(this.BQ, param1Int);
      if (i >= 0) {
        String[] arrayOfString = this.W;
        if (i < arrayOfString.length - 1) {
          int[] arrayOfInt = this.BQ;
          int j = i + 1;
          if (arrayOfInt[j] == param1Int)
            return arrayOfString[j]; 
        } 
        return arrayOfString[i];
      } 
      return "";
    }
    
    int u(String param1String) {
      int i = Arrays.binarySearch((Object[])this.I, param1String);
      if (i >= 0) {
        i = this.oC[i];
      } else {
        i = -1;
      } 
      return i;
    }
  }
  
  enum yh {
    V0, h, j;
    
    private static final yh[] q;
    
    static {
      yh yh2 = new yh("ascii", 0);
      h = yh2;
      yh yh1 = new yh("utf", 1);
      V0 = yh1;
      yh yh3 = new yh("fallback", 2);
      j = yh3;
      q = new yh[] { yh2, yh1, yh3 };
    }
    
    public static yh[] V0() {
      return (yh[])q.clone();
    }
    
    static yh h(String param1String) {
      return param1String.equals("US-ASCII") ? h : (param1String.startsWith("UTF-") ? V0 : j);
    }
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/XR.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */